<!DOCTYPE html>
<html>
<head>
<!-- 	<link rel="stylesheet" type="text/css" href="http://www.jq22.com/jquery/font-awesome.4.6.0.css"> -->

  <link rel="stylesheet" href="../../static/css/font-awesome.4.6.0.css">

	<link href="../../static/css/froala_editor.min.css" rel="stylesheet" type="text/css">


    <style>
        body {
            text-align: center;
        }

        section {
            width: 80%;
            margin: auto;
            text-align: left;
        }
    </style>
</head>

<body>

  <section id="editor">
      <div id='edit' style="margin-top: 30px;">


          <h1>问题内容请写在这里~</h1>

          
      </div>
  </section>

  
  <div id="number" style="color:blue;size:"200px">问题优先级请选择：<select id="num"></select></div>
  
  <button type="button" id="show_news" style="color:red;size:"200px">提交</button>
  

  
  
<script src="../../static/js/jquery-1.10.2.js"></script>
  <script src="../../static/js/froala_editor.min.js"></script>
  <!--[if lt IE 9]>
    <script src="../js/froala_editor_ie8.min.js"></script>
  <![endif]-->
  <script src="../../static/js/plugins/tables.min.js"></script>
  <script src="../../static/js/plugins/lists.min.js"></script>
  <script src="../../static/js/plugins/colors.min.js"></script>
  <script src="../../static/js/plugins/media_manager.min.js"></script>
  <script src="../../static/js/plugins/font_family.min.js"></script>
  <script src="../../static/js/plugins/font_size.min.js"></script>
  <script src="../../static/js/plugins/block_styles.min.js"></script>
  <script src="../../static/js/plugins/video.min.js"></script>

  <script>
	$(function(){
	  $('#edit').editable({inlineMode: false, alwaysBlank: true})
	});
	
	
	for (var i=0;i<100;i++)
	{
		$("#num").append('<option value ="'+i+'">'+i+'</option>');
	}
	
	$("#show_news").on("click",function(){
		
		var news_html = $(".froala-element").html()
		var priority = $("#num option:selected").html();	
		
		params = {
			"news_html":news_html,
			"priority":priority,
		}
		
		$.ajax({			
			url:"/app/questions/add",
			type:"POST",
            data:JSON.stringify(params),
            contentType:'application/json',
			success:function(res){
                if(res.status == 0){
					alert("问题添加成功");
                    location.href="/app/show/questions_list";
                }else {
                    alert(res.msg);
                }
            }
		
		});
	})
  </script>
</body>


</html>
